<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>module RSS::ListenerMixin - rss: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="module">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-_ns">#_ns</a>
    <li ><a href="#method-i-check_ns">#check_ns</a>
    <li ><a href="#method-i-collect_attributes">#collect_attributes</a>
    <li ><a href="#method-i-initial_start_RDF">#initial_start_RDF</a>
    <li ><a href="#method-i-initial_start_entry">#initial_start_entry</a>
    <li ><a href="#method-i-initial_start_feed">#initial_start_feed</a>
    <li ><a href="#method-i-initial_start_rss">#initial_start_rss</a>
    <li ><a href="#method-i-instruction">#instruction</a>
    <li ><a href="#method-i-known_class-3F">#known_class?</a>
    <li ><a href="#method-i-parse_pi_content">#parse_pi_content</a>
    <li ><a href="#method-i-setup_next_element">#setup_next_element</a>
    <li ><a href="#method-i-setup_next_element_in_unknown_element">#setup_next_element_in_unknown_element</a>
    <li ><a href="#method-i-split_name">#split_name</a>
    <li ><a href="#method-i-start_else_element">#start_else_element</a>
    <li ><a href="#method-i-start_get_text_element">#start_get_text_element</a>
    <li ><a href="#method-i-start_have_something_element">#start_have_something_element</a>
    <li ><a href="#method-i-tag_end">#tag_end</a>
    <li ><a href="#method-i-tag_start">#tag_start</a>
    <li ><a href="#method-i-text">#text</a>
    <li ><a href="#method-i-xmldecl">#xmldecl</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="module-RSS::ListenerMixin">
    <h1 id="module-RSS::ListenerMixin" class="module">
      module RSS::ListenerMixin
    </h1>

    <section class="description">
    
    </section>

      <section id="5Buntitled-5D" class="documentation-section">


      <section class="constants-list">
      <header>
      <h3>Constants</h3>
      </header>
      <dl>
          <dt id="CONTENT_PATTERN">CONTENT_PATTERN
          <dd>
          <dt id="NAMESPLIT">NAMESPLIT
          <dd>
        </dl>
        </section>

        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-i-do_validate" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">do_validate</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-ignore_unknown_element" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">ignore_unknown_element</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-rss" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">rss</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
            </section>


                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/parser.rb, line 286</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>
  <span class="ruby-ivar">@rss</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@ignore_unknown_element</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-ivar">@do_validate</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-ivar">@ns_stack</span> = [{<span class="ruby-string">&quot;xml&quot;</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-value">:xml</span>}]
  <span class="ruby-ivar">@tag_stack</span> = [[]]
  <span class="ruby-ivar">@text_stack</span> = [<span class="ruby-string">&#39;&#39;</span>]
  <span class="ruby-ivar">@proc_stack</span> = []
  <span class="ruby-ivar">@last_element</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@version</span> = <span class="ruby-ivar">@encoding</span> = <span class="ruby-ivar">@standalone</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@xml_stylesheets</span> = []
  <span class="ruby-ivar">@xml_child_mode</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@xml_element</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@last_xml_element</span> = <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-instruction" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">instruction</span><span
                                class="method-args">(name, content)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="instruction-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/parser.rb, line 307</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">instruction</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">content</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;xml-stylesheet&quot;</span>
    <span class="ruby-identifier">params</span> = <span class="ruby-identifier">parse_pi_content</span>(<span class="ruby-identifier">content</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">params</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-string">&quot;href&quot;</span>)
      <span class="ruby-ivar">@xml_stylesheets</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">XMLStyleSheet</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">params</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-tag_end" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">tag_end</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="tag_end-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/parser.rb, line 369</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">tag_end</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-constant">DEBUG</span>
    <span class="ruby-identifier">p</span> <span class="ruby-node">&quot;end tag #{name}&quot;</span>
    <span class="ruby-identifier">p</span> <span class="ruby-ivar">@tag_stack</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">text</span> = <span class="ruby-ivar">@text_stack</span>.<span class="ruby-identifier">pop</span>
  <span class="ruby-identifier">tags</span> = <span class="ruby-ivar">@tag_stack</span>.<span class="ruby-identifier">pop</span>
  <span class="ruby-identifier">pr</span> = <span class="ruby-ivar">@proc_stack</span>.<span class="ruby-identifier">pop</span>
  <span class="ruby-identifier">pr</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">text</span>, <span class="ruby-identifier">tags</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">pr</span>.<span class="ruby-identifier">nil?</span>
  <span class="ruby-ivar">@ns_stack</span>.<span class="ruby-identifier">pop</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-tag_start" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">tag_start</span><span
                                class="method-args">(name, attributes)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="tag_start-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/parser.rb, line 316</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">tag_start</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">attributes</span>)
  <span class="ruby-ivar">@text_stack</span>.<span class="ruby-identifier">push</span>(<span class="ruby-string">&#39;&#39;</span>)

  <span class="ruby-identifier">ns</span> = <span class="ruby-ivar">@ns_stack</span>.<span class="ruby-identifier">last</span>.<span class="ruby-identifier">dup</span>
  <span class="ruby-identifier">attrs</span> = {}
  <span class="ruby-identifier">attributes</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-regexp">/\Axmlns(?:\z|:)/</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">n</span>
      <span class="ruby-identifier">ns</span>[<span class="ruby-identifier">$POSTMATCH</span>] = <span class="ruby-identifier">v</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">attrs</span>[<span class="ruby-identifier">n</span>] = <span class="ruby-identifier">v</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@ns_stack</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">ns</span>)

  <span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">local</span> = <span class="ruby-identifier">split_name</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-ivar">@tag_stack</span>.<span class="ruby-identifier">last</span>.<span class="ruby-identifier">push</span>([<span class="ruby-identifier">_ns</span>(<span class="ruby-identifier">ns</span>, <span class="ruby-identifier">prefix</span>), <span class="ruby-identifier">local</span>])
  <span class="ruby-ivar">@tag_stack</span>.<span class="ruby-identifier">push</span>([])
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@xml_child_mode</span>
    <span class="ruby-identifier">previous</span> = <span class="ruby-ivar">@last_xml_element</span>
    <span class="ruby-identifier">element_attrs</span> = <span class="ruby-identifier">attributes</span>.<span class="ruby-identifier">dup</span>
    <span class="ruby-keyword">unless</span> <span class="ruby-identifier">previous</span>
      <span class="ruby-identifier">ns</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ns_prefix</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
        <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">ns_prefix</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;xml&quot;</span>
        <span class="ruby-identifier">key</span> = <span class="ruby-identifier">ns_prefix</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">?</span> <span class="ruby-string">&quot;xmlns&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-node">&quot;xmlns:#{ns_prefix}&quot;</span>
        <span class="ruby-identifier">element_attrs</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">value</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">next_element</span> = <span class="ruby-constant">XML</span><span class="ruby-operator">::</span><span class="ruby-constant">Element</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">local</span>,
                                    <span class="ruby-identifier">prefix</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">?</span> <span class="ruby-keyword">nil</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">prefix</span>,
                                    <span class="ruby-identifier">_ns</span>(<span class="ruby-identifier">ns</span>, <span class="ruby-identifier">prefix</span>),
                                    <span class="ruby-identifier">element_attrs</span>)
    <span class="ruby-identifier">previous</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">next_element</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">previous</span>
    <span class="ruby-ivar">@last_xml_element</span> = <span class="ruby-identifier">next_element</span>
    <span class="ruby-identifier">pr</span> = <span class="ruby-constant">Proc</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">text</span>, <span class="ruby-identifier">tags</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">previous</span>
        <span class="ruby-ivar">@last_xml_element</span> = <span class="ruby-identifier">previous</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-ivar">@xml_element</span> = <span class="ruby-ivar">@last_xml_element</span>
        <span class="ruby-ivar">@last_xml_element</span> = <span class="ruby-keyword">nil</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@proc_stack</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">pr</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@rss</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-node">&quot;initial_start_#{local}&quot;</span>, <span class="ruby-keyword">true</span>)
      <span class="ruby-identifier">__send__</span>(<span class="ruby-node">&quot;initial_start_#{local}&quot;</span>, <span class="ruby-identifier">local</span>, <span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">attrs</span>, <span class="ruby-identifier">ns</span>.<span class="ruby-identifier">dup</span>)
    <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-node">&quot;start_#{local}&quot;</span>, <span class="ruby-keyword">true</span>)
      <span class="ruby-identifier">__send__</span>(<span class="ruby-node">&quot;start_#{local}&quot;</span>, <span class="ruby-identifier">local</span>, <span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">attrs</span>, <span class="ruby-identifier">ns</span>.<span class="ruby-identifier">dup</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">start_else_element</span>(<span class="ruby-identifier">local</span>, <span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">attrs</span>, <span class="ruby-identifier">ns</span>.<span class="ruby-identifier">dup</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-text" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">text</span><span
                                class="method-args">(data)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="text-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/parser.rb, line 381</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">text</span>(<span class="ruby-identifier">data</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@xml_child_mode</span>
    <span class="ruby-ivar">@last_xml_element</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">data</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@last_xml_element</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@text_stack</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">data</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-xmldecl" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">xmldecl</span><span
                                class="method-args">(version, encoding, standalone)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>set instance vars for version, encoding, standalone</p>

                              <div class="method-source-code" id="xmldecl-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/parser.rb, line 303</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">xmldecl</span>(<span class="ruby-identifier">version</span>, <span class="ruby-identifier">encoding</span>, <span class="ruby-identifier">standalone</span>)
  <span class="ruby-ivar">@version</span>, <span class="ruby-ivar">@encoding</span>, <span class="ruby-ivar">@standalone</span> = <span class="ruby-identifier">version</span>, <span class="ruby-identifier">encoding</span>, <span class="ruby-identifier">standalone</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="private-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Private Instance Methods</h3>
                </header>

                  <div id="method-i-_ns" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">_ns</span><span
                                class="method-args">(ns, prefix)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="_ns-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/parser.rb, line 390</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">_ns</span>(<span class="ruby-identifier">ns</span>, <span class="ruby-identifier">prefix</span>)
  <span class="ruby-identifier">ns</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">prefix</span>, <span class="ruby-string">&quot;&quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-check_ns" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">check_ns</span><span
                                class="method-args">(tag_name, prefix, ns, require_uri, ignore_unknown_element=nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="check_ns-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/parser.rb, line 445</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">check_ns</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">ns</span>, <span class="ruby-identifier">require_uri</span>, <span class="ruby-identifier">ignore_unknown_element</span>=<span class="ruby-keyword">nil</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">_ns</span>(<span class="ruby-identifier">ns</span>, <span class="ruby-identifier">prefix</span>) <span class="ruby-operator">==</span> <span class="ruby-identifier">require_uri</span>
    <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">ignore_unknown_element</span>.<span class="ruby-identifier">nil?</span>
      <span class="ruby-identifier">ignore_unknown_element</span> = <span class="ruby-ivar">@ignore_unknown_element</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">ignore_unknown_element</span>
      <span class="ruby-keyword">false</span>
    <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@do_validate</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-constant">NSError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">require_uri</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-comment"># Force bind required URI with prefix</span>
      <span class="ruby-ivar">@ns_stack</span>.<span class="ruby-identifier">last</span>[<span class="ruby-identifier">prefix</span>] = <span class="ruby-identifier">require_uri</span>
      <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-collect_attributes" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">collect_attributes</span><span
                                class="method-args">(tag_name, prefix, attrs, ns, klass)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="collect_attributes-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/parser.rb, line 495</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">collect_attributes</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">attrs</span>, <span class="ruby-identifier">ns</span>, <span class="ruby-identifier">klass</span>)
  <span class="ruby-identifier">attributes</span> = {}
  <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">get_attributes</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">a_name</span>, <span class="ruby-identifier">a_uri</span>, <span class="ruby-identifier">required</span>, <span class="ruby-identifier">element_name</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">a_uri</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>) <span class="ruby-keyword">or</span> <span class="ruby-operator">!</span><span class="ruby-identifier">a_uri</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:include?</span>)
      <span class="ruby-identifier">a_uri</span> = [<span class="ruby-identifier">a_uri</span>]
    <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">unless</span> <span class="ruby-identifier">a_uri</span> <span class="ruby-operator">==</span> [<span class="ruby-string">&quot;&quot;</span>]
      <span class="ruby-keyword">for</span> <span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">uri</span> <span class="ruby-keyword">in</span> <span class="ruby-identifier">ns</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">a_uri</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">uri</span>)
          <span class="ruby-identifier">val</span> = <span class="ruby-identifier">attrs</span>[<span class="ruby-node">&quot;#{prefix}:#{a_name}&quot;</span>]
          <span class="ruby-keyword">break</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">val</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">a_uri</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-string">&quot;&quot;</span>)
      <span class="ruby-identifier">val</span> = <span class="ruby-identifier">attrs</span>[<span class="ruby-identifier">a_name</span>]
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@do_validate</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">required</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">nil?</span>
      <span class="ruby-keyword">unless</span> <span class="ruby-identifier">a_uri</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-string">&quot;&quot;</span>)
        <span class="ruby-keyword">for</span> <span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">uri</span> <span class="ruby-keyword">in</span> <span class="ruby-identifier">ns</span>
          <span class="ruby-keyword">if</span> <span class="ruby-identifier">a_uri</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">uri</span>)
            <span class="ruby-identifier">a_name</span> = <span class="ruby-node">&quot;#{prefix}:#{a_name}&quot;</span>
          <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-constant">MissingAttributeError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">a_name</span>)
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">attributes</span>[<span class="ruby-identifier">a_name</span>] = <span class="ruby-identifier">val</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">attributes</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-initial_start_RDF" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">initial_start_RDF</span><span
                                class="method-args">(tag_name, prefix, attrs, ns)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="initial_start_RDF-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/1.0.rb, line 471</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initial_start_RDF</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">attrs</span>, <span class="ruby-identifier">ns</span>)
  <span class="ruby-identifier">check_ns</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">ns</span>, <span class="ruby-constant">RDF</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>, <span class="ruby-keyword">false</span>)

  <span class="ruby-ivar">@rss</span> = <span class="ruby-constant">RDF</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@version</span>, <span class="ruby-ivar">@encoding</span>, <span class="ruby-ivar">@standalone</span>)
  <span class="ruby-ivar">@rss</span>.<span class="ruby-identifier">do_validate</span> = <span class="ruby-ivar">@do_validate</span>
  <span class="ruby-ivar">@rss</span>.<span class="ruby-identifier">xml_stylesheets</span> = <span class="ruby-ivar">@xml_stylesheets</span>
  <span class="ruby-ivar">@last_element</span> = <span class="ruby-ivar">@rss</span>
  <span class="ruby-identifier">pr</span> = <span class="ruby-constant">Proc</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">text</span>, <span class="ruby-identifier">tags</span><span class="ruby-operator">|</span>
    <span class="ruby-ivar">@rss</span>.<span class="ruby-identifier">validate_for_stream</span>(<span class="ruby-identifier">tags</span>, <span class="ruby-ivar">@ignore_unknown_element</span>) <span class="ruby-keyword">if</span> <span class="ruby-ivar">@do_validate</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@proc_stack</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">pr</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-initial_start_entry" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">initial_start_entry</span><span
                                class="method-args">(tag_name, prefix, attrs, ns)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="initial_start_entry-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/atom.rb, line 1010</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initial_start_entry</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">attrs</span>, <span class="ruby-identifier">ns</span>)
  <span class="ruby-identifier">check_ns</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">ns</span>, <span class="ruby-constant">Atom</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>, <span class="ruby-keyword">false</span>)

  <span class="ruby-ivar">@rss</span> = <span class="ruby-constant">Atom</span><span class="ruby-operator">::</span><span class="ruby-constant">Entry</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@version</span>, <span class="ruby-ivar">@encoding</span>, <span class="ruby-ivar">@standalone</span>)
  <span class="ruby-ivar">@rss</span>.<span class="ruby-identifier">do_validate</span> = <span class="ruby-ivar">@do_validate</span>
  <span class="ruby-ivar">@rss</span>.<span class="ruby-identifier">xml_stylesheets</span> = <span class="ruby-ivar">@xml_stylesheets</span>
  <span class="ruby-ivar">@rss</span>.<span class="ruby-identifier">lang</span> = <span class="ruby-identifier">attrs</span>[<span class="ruby-string">&quot;xml:lang&quot;</span>]
  <span class="ruby-ivar">@rss</span>.<span class="ruby-identifier">base</span> = <span class="ruby-identifier">attrs</span>[<span class="ruby-string">&quot;xml:base&quot;</span>]
  <span class="ruby-ivar">@last_element</span> = <span class="ruby-ivar">@rss</span>
  <span class="ruby-identifier">pr</span> = <span class="ruby-constant">Proc</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">text</span>, <span class="ruby-identifier">tags</span><span class="ruby-operator">|</span>
    <span class="ruby-ivar">@rss</span>.<span class="ruby-identifier">validate_for_stream</span>(<span class="ruby-identifier">tags</span>) <span class="ruby-keyword">if</span> <span class="ruby-ivar">@do_validate</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@proc_stack</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">pr</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-initial_start_feed" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">initial_start_feed</span><span
                                class="method-args">(tag_name, prefix, attrs, ns)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="initial_start_feed-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/atom.rb, line 995</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initial_start_feed</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">attrs</span>, <span class="ruby-identifier">ns</span>)
  <span class="ruby-identifier">check_ns</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">ns</span>, <span class="ruby-constant">Atom</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>, <span class="ruby-keyword">false</span>)

  <span class="ruby-ivar">@rss</span> = <span class="ruby-constant">Atom</span><span class="ruby-operator">::</span><span class="ruby-constant">Feed</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@version</span>, <span class="ruby-ivar">@encoding</span>, <span class="ruby-ivar">@standalone</span>)
  <span class="ruby-ivar">@rss</span>.<span class="ruby-identifier">do_validate</span> = <span class="ruby-ivar">@do_validate</span>
  <span class="ruby-ivar">@rss</span>.<span class="ruby-identifier">xml_stylesheets</span> = <span class="ruby-ivar">@xml_stylesheets</span>
  <span class="ruby-ivar">@rss</span>.<span class="ruby-identifier">lang</span> = <span class="ruby-identifier">attrs</span>[<span class="ruby-string">&quot;xml:lang&quot;</span>]
  <span class="ruby-ivar">@rss</span>.<span class="ruby-identifier">base</span> = <span class="ruby-identifier">attrs</span>[<span class="ruby-string">&quot;xml:base&quot;</span>]
  <span class="ruby-ivar">@last_element</span> = <span class="ruby-ivar">@rss</span>
  <span class="ruby-identifier">pr</span> = <span class="ruby-constant">Proc</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">text</span>, <span class="ruby-identifier">tags</span><span class="ruby-operator">|</span>
    <span class="ruby-ivar">@rss</span>.<span class="ruby-identifier">validate_for_stream</span>(<span class="ruby-identifier">tags</span>) <span class="ruby-keyword">if</span> <span class="ruby-ivar">@do_validate</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@proc_stack</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">pr</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-initial_start_rss" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">initial_start_rss</span><span
                                class="method-args">(tag_name, prefix, attrs, ns)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="initial_start_rss-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/0.9.rb, line 447</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initial_start_rss</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">attrs</span>, <span class="ruby-identifier">ns</span>)
  <span class="ruby-identifier">check_ns</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">ns</span>, <span class="ruby-string">&quot;&quot;</span>, <span class="ruby-keyword">false</span>)

  <span class="ruby-ivar">@rss</span> = <span class="ruby-constant">Rss</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">attrs</span>[<span class="ruby-string">&#39;version&#39;</span>], <span class="ruby-ivar">@version</span>, <span class="ruby-ivar">@encoding</span>, <span class="ruby-ivar">@standalone</span>)
  <span class="ruby-ivar">@rss</span>.<span class="ruby-identifier">do_validate</span> = <span class="ruby-ivar">@do_validate</span>
  <span class="ruby-ivar">@rss</span>.<span class="ruby-identifier">xml_stylesheets</span> = <span class="ruby-ivar">@xml_stylesheets</span>
  <span class="ruby-ivar">@last_element</span> = <span class="ruby-ivar">@rss</span>
  <span class="ruby-identifier">pr</span> = <span class="ruby-constant">Proc</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">text</span>, <span class="ruby-identifier">tags</span><span class="ruby-operator">|</span>
    <span class="ruby-ivar">@rss</span>.<span class="ruby-identifier">validate_for_stream</span>(<span class="ruby-identifier">tags</span>, <span class="ruby-ivar">@ignore_unknown_element</span>) <span class="ruby-keyword">if</span> <span class="ruby-ivar">@do_validate</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@proc_stack</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">pr</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-known_class-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">known_class?</span><span
                                class="method-args">(target_class, class_name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="known_class-3F-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/parser.rb, line 426</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">known_class?</span>(<span class="ruby-identifier">target_class</span>, <span class="ruby-identifier">class_name</span>)
  <span class="ruby-identifier">class_name</span> <span class="ruby-keyword">and</span>
    (<span class="ruby-identifier">target_class</span>.<span class="ruby-identifier">const_defined?</span>(<span class="ruby-identifier">class_name</span>, <span class="ruby-keyword">false</span>) <span class="ruby-keyword">or</span>
     <span class="ruby-identifier">target_class</span>.<span class="ruby-identifier">constants</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">class_name</span>.<span class="ruby-identifier">to_sym</span>))
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-parse_pi_content" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">parse_pi_content</span><span
                                class="method-args">(content)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Extract the first name=“value” pair from content. Works with single quotes according to the constant <a href="ListenerMixin.html#CONTENT_PATTERN"><code>CONTENT_PATTERN</code></a>. Return a Hash.</p>

                              <div class="method-source-code" id="parse_pi_content-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/parser.rb, line 398</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">parse_pi_content</span>(<span class="ruby-identifier">content</span>)
  <span class="ruby-identifier">params</span> = {}
  <span class="ruby-identifier">content</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-constant">CONTENT_PATTERN</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">quote</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">params</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">value</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">params</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-setup_next_element" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">setup_next_element</span><span
                                class="method-args">(tag_name, klass, attributes)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="setup_next_element-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/parser.rb, line 529</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">setup_next_element</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">klass</span>, <span class="ruby-identifier">attributes</span>)
  <span class="ruby-identifier">previous</span> = <span class="ruby-ivar">@last_element</span>
  <span class="ruby-identifier">next_element</span> = <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@do_validate</span>, <span class="ruby-identifier">attributes</span>)
  <span class="ruby-identifier">previous</span>.<span class="ruby-identifier">set_next_element</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">next_element</span>)
  <span class="ruby-ivar">@last_element</span> = <span class="ruby-identifier">next_element</span>
  <span class="ruby-ivar">@last_element</span>.<span class="ruby-identifier">parent</span> = <span class="ruby-identifier">previous</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">need_parent?</span>
  <span class="ruby-ivar">@xml_child_mode</span> = <span class="ruby-ivar">@last_element</span>.<span class="ruby-identifier">have_xml_content?</span>

  <span class="ruby-constant">Proc</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">text</span>, <span class="ruby-identifier">tags</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">p</span>(<span class="ruby-ivar">@last_element</span>.<span class="ruby-identifier">class</span>) <span class="ruby-keyword">if</span> <span class="ruby-constant">DEBUG</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@xml_child_mode</span>
      <span class="ruby-ivar">@last_element</span>.<span class="ruby-identifier">content</span> = <span class="ruby-ivar">@xml_element</span>.<span class="ruby-identifier">to_s</span>
      <span class="ruby-identifier">xml_setter</span> = <span class="ruby-ivar">@last_element</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">xml_setter</span>
      <span class="ruby-ivar">@last_element</span>.<span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">xml_setter</span>, <span class="ruby-ivar">@xml_element</span>)
      <span class="ruby-ivar">@xml_element</span> = <span class="ruby-keyword">nil</span>
      <span class="ruby-ivar">@xml_child_mode</span> = <span class="ruby-keyword">false</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">have_content?</span>
        <span class="ruby-keyword">if</span> <span class="ruby-ivar">@last_element</span>.<span class="ruby-identifier">need_base64_encode?</span>
          <span class="ruby-identifier">text</span> = <span class="ruby-identifier">text</span>.<span class="ruby-identifier">lstrip</span>.<span class="ruby-identifier">unpack</span>(<span class="ruby-string">&quot;m&quot;</span>).<span class="ruby-identifier">first</span>
        <span class="ruby-keyword">end</span>
        <span class="ruby-ivar">@last_element</span>.<span class="ruby-identifier">content</span> = <span class="ruby-identifier">text</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@do_validate</span>
      <span class="ruby-ivar">@last_element</span>.<span class="ruby-identifier">validate_for_stream</span>(<span class="ruby-identifier">tags</span>, <span class="ruby-ivar">@ignore_unknown_element</span>)
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@last_element</span> = <span class="ruby-identifier">previous</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-setup_next_element_in_unknown_element" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">setup_next_element_in_unknown_element</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="setup_next_element_in_unknown_element-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/parser.rb, line 560</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">setup_next_element_in_unknown_element</span>
  <span class="ruby-identifier">current_element</span>, <span class="ruby-ivar">@last_element</span> = <span class="ruby-ivar">@last_element</span>, <span class="ruby-keyword">nil</span>
  <span class="ruby-constant">Proc</span>.<span class="ruby-identifier">new</span> {<span class="ruby-ivar">@last_element</span> = <span class="ruby-identifier">current_element</span>}
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-split_name" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">split_name</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="split_name-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/parser.rb, line 440</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">split_name</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">name</span> <span class="ruby-operator">=~</span> <span class="ruby-constant">NAMESPLIT</span>
  [<span class="ruby-node">$1</span> <span class="ruby-operator">||</span> <span class="ruby-string">&#39;&#39;</span>, <span class="ruby-node">$2</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-start_else_element" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">start_else_element</span><span
                                class="method-args">(local, prefix, attrs, ns)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="start_else_element-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/parser.rb, line 406</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">start_else_element</span>(<span class="ruby-identifier">local</span>, <span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">attrs</span>, <span class="ruby-identifier">ns</span>)
  <span class="ruby-identifier">class_name</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">class_name</span>(<span class="ruby-identifier">_ns</span>(<span class="ruby-identifier">ns</span>, <span class="ruby-identifier">prefix</span>), <span class="ruby-identifier">local</span>)
  <span class="ruby-identifier">current_class</span> = <span class="ruby-ivar">@last_element</span>.<span class="ruby-identifier">class</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">known_class?</span>(<span class="ruby-identifier">current_class</span>, <span class="ruby-identifier">class_name</span>)
    <span class="ruby-identifier">next_class</span> = <span class="ruby-identifier">current_class</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-identifier">class_name</span>)
    <span class="ruby-identifier">start_have_something_element</span>(<span class="ruby-identifier">local</span>, <span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">attrs</span>, <span class="ruby-identifier">ns</span>, <span class="ruby-identifier">next_class</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@do_validate</span> <span class="ruby-keyword">or</span> <span class="ruby-ivar">@ignore_unknown_element</span>
      <span class="ruby-ivar">@proc_stack</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">setup_next_element_in_unknown_element</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">parent</span> = <span class="ruby-string">&quot;ROOT ELEMENT???&quot;</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">current_class</span>.<span class="ruby-identifier">tag_name</span>
        <span class="ruby-identifier">parent</span> = <span class="ruby-identifier">current_class</span>.<span class="ruby-identifier">tag_name</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-constant">NotExpectedTagError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">local</span>, <span class="ruby-identifier">_ns</span>(<span class="ruby-identifier">ns</span>, <span class="ruby-identifier">prefix</span>), <span class="ruby-identifier">parent</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-start_get_text_element" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">start_get_text_element</span><span
                                class="method-args">(tag_name, prefix, ns, required_uri)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="start_get_text_element-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/parser.rb, line 465</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">start_get_text_element</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">ns</span>, <span class="ruby-identifier">required_uri</span>)
  <span class="ruby-identifier">pr</span> = <span class="ruby-constant">Proc</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">text</span>, <span class="ruby-identifier">tags</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">setter</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">setter</span>(<span class="ruby-identifier">required_uri</span>, <span class="ruby-identifier">tag_name</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">setter</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@last_element</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">setter</span>)
      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@do_validate</span>
        <span class="ruby-identifier">getter</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">getter</span>(<span class="ruby-identifier">required_uri</span>, <span class="ruby-identifier">tag_name</span>)
        <span class="ruby-keyword">if</span> <span class="ruby-ivar">@last_element</span>.<span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">getter</span>)
          <span class="ruby-identifier">raise</span> <span class="ruby-constant">TooMuchTagError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-ivar">@last_element</span>.<span class="ruby-identifier">tag_name</span>)
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-ivar">@last_element</span>.<span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">setter</span>, <span class="ruby-identifier">text</span>.<span class="ruby-identifier">to_s</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@do_validate</span> <span class="ruby-keyword">and</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@ignore_unknown_element</span>
        <span class="ruby-identifier">raise</span> <span class="ruby-constant">NotExpectedTagError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">_ns</span>(<span class="ruby-identifier">ns</span>, <span class="ruby-identifier">prefix</span>),
                                      <span class="ruby-ivar">@last_element</span>.<span class="ruby-identifier">tag_name</span>)
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@proc_stack</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">pr</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-start_have_something_element" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">start_have_something_element</span><span
                                class="method-args">(tag_name, prefix, attrs, ns, klass)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="start_have_something_element-source">
            <pre><span class="ruby-comment"># File rss-0.3.0/lib/rss/parser.rb, line 486</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">start_have_something_element</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">attrs</span>, <span class="ruby-identifier">ns</span>, <span class="ruby-identifier">klass</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">check_ns</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">ns</span>, <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">required_uri</span>)
    <span class="ruby-identifier">attributes</span> = <span class="ruby-identifier">collect_attributes</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">attrs</span>, <span class="ruby-identifier">ns</span>, <span class="ruby-identifier">klass</span>)
    <span class="ruby-ivar">@proc_stack</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">setup_next_element</span>(<span class="ruby-identifier">tag_name</span>, <span class="ruby-identifier">klass</span>, <span class="ruby-identifier">attributes</span>))
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@proc_stack</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">setup_next_element_in_unknown_element</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>.</p><p><a href="https://jamesbritt.bandcamp.com/">Maximum R+D</a>.  </p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

